0f92ae23bc99fbe9ad9771be57c84db32a4fbef5,src/java/org/orbeon/oxf/processor/xforms/output/element/XFormsElement.java,XFormsElement,start,#XFormsElementContext#String#String#String#Attributes#,83

Before Change


        if (("if".equals(localname) || "when".equals(localname)) && XFormsConstants.XXFORMS_NAMESPACE_URI.equals(uri)) {
            String test = attributes.getValue("test");
            final FunctionLibrary fncLib = context.getFunctionLibrary();
            Boolean value = (Boolean) context.getCurrentInstance().evaluateXPathSingle(context.getPipelineContext(), context.getCurrentSingleNode(),
                    "boolean(" + test + ")", prefixToURI, context.getRepeatIdToIndex(), fncLib, null);

            addExtensionAttribute(newAttributes, "value", Boolean.toString(value.booleanValue()));

After Change



                final String atExpression = attributes.getValue("at");
                final Node contextNode = context.getCurrentSingleNode();
                if (contextNode == null)
                    throw new ValidationException("null context node for number 'at' expression: " + atExpression, new LocationData(context.getLocator()));

                final Object at = context.getCurrentInstance().evaluateXPathSingle(context.getPipelineContext(), context.getCurrentSingleNode(),
                        "round(" + atExpression + ")", context.getCurrentPrefixToURIMap(), null, context.getFunctionLibrary(), null);

                if (!(at instanceof Number))
                    throw new ValidationException("'at' expression must return a number",
                            new LocationData(context.getLocator()));
                String atString = at.toString();
                if (XFormsUtils.isNameEncryptionEnabled())
                    atString = SecureUtils.encrypt(context.getPipelineContext(),
                            context.getEncryptionPassword(), atString);
                addExtensionAttribute(newAttributes, "at-value", atString);
            }
            if (attributes.getIndex("", "value") != -1) {
                // Evaluate "value" as a string

                final String valueExpression = attributes.getValue("value");
                final Node contextNode = context.getCurrentSingleNode();
                if (contextNode == null)
                    throw new ValidationException("null context node for string 'value' expression: " + valueExpression, new LocationData(context.getLocator()));